package main

import (
	"fmt"
)

var (
	MajorVersionNumber = 0
	MinorVersionNumber = 1
	RevisionNumber     = 0

	BuildNumber string
	BuildTime   string
	GoVersion   string
)

func PrintVersion() {
	fmt.Println(fmt.Sprintf("Service Version:	%d.%d.%d build-%s", MajorVersionNumber, MinorVersionNumber, RevisionNumber, BuildNumber))
	fmt.Println(fmt.Sprintf("Git commit:	%s", BuildNumber))
	fmt.Println(fmt.Sprintf("Build Time:	%s", BuildTime))
	fmt.Println(fmt.Sprintf("Go Version:	%s", GoVersion))
}

func FormatVersion() string {
	sv := fmt.Sprintf("%d.%d.%d build-%s\n", MajorVersionNumber, MinorVersionNumber, RevisionNumber, BuildNumber)
	gc := fmt.Sprintf("Git commit:	%s\n", BuildNumber)
	bt := fmt.Sprintf("Build Time:	%s\n", BuildTime)
	gv := fmt.Sprintf("Go Version:	%s\n", GoVersion)

	return fmt.Sprintf("%s%s%s%s", sv, gc, bt, gv)
}
